Optimal. Leaf size=62 \[ \frac {A+i B}{2 d (a+i a \tan (c+d x))}-\frac {x (-B+i A)}{2 a}+\frac {A \log (\sin (c+d x))}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.094, Rules used = {3596, 3531, 3475} \[ \frac {A+i B}{2 d (a+i a \tan (c+d x))}-\frac {x (-B+i A)}{2 a}+\frac {A \log (\sin (c+d x))}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3531
Rule 3596
Rubi steps
\begin {align*} \int \frac {\cot (c+d x) (A+B \tan (c+d x))}{a+i a \tan (c+d x)} \, dx &=\frac {A+i B}{2 d (a+i a \tan (c+d x))}+\frac {\int \cot (c+d x) (2 a A-a (i A-B) \tan (c+d x)) \, dx}{2 a^2}\\ &=-\frac {(i A-B) x}{2 a}+\frac {A+i B}{2 d (a+i a \tan (c+d x))}+\frac {A \int \cot (c+d x) \, dx}{a}\\ &=-\frac {(i A-B) x}{2 a}+\frac {A \log (\sin (c+d x))}{a d}+\frac {A+i B}{2 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.14, size = 150, normalized size = 2.42 \[ \frac {\cos (c+d x) (A+B \tan (c+d x)) \left (\tan (c+d x) \left (2 A \log \left (\sin ^2(c+d x)\right )+2 i A d x-A+2 B d x-i B\right )-4 i A \tan ^{-1}(\tan (d x)) (\tan (c+d x)-i)-2 i A \log \left (\sin ^2(c+d x)\right )+2 A d x-i A-2 i B d x+B\right )}{4 a d (\tan (c+d x)-i) (A \cos (c+d x)+B \sin (c+d x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.67, size = 65, normalized size = 1.05 \[ \frac {{\left ({\left (-6 i \, A + 2 \, B\right )} d x e^{\left (2 i \, d x + 2 i \, c\right )} + 4 \, A e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) + A + i \, B\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.46, size = 99, normalized size = 1.60 \[ -\frac {\frac {{\left (3 \, A + i \, B\right )} \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac {{\left (A - i \, B\right )} \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a} - \frac {4 \, A \log \left (\tan \left (d x + c\right )\right )}{a} - \frac {3 \, A \tan \left (d x + c\right ) + i \, B \tan \left (d x + c\right ) - 5 i \, A + 3 \, B}{a {\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.77, size = 136, normalized size = 2.19 \[ -\frac {A \ln \left (\tan \left (d x +c \right )+i\right )}{4 d a}+\frac {i B \ln \left (\tan \left (d x +c \right )+i\right )}{4 d a}+\frac {A \ln \left (\tan \left (d x +c \right )\right )}{d a}-\frac {i A}{2 d a \left (\tan \left (d x +c \right )-i\right )}+\frac {B}{2 d a \left (\tan \left (d x +c \right )-i\right )}-\frac {3 \ln \left (\tan \left (d x +c \right )-i\right ) A}{4 d a}-\frac {i \ln \left (\tan \left (d x +c \right )-i\right ) B}{4 d a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.26, size = 98, normalized size = 1.58 \[ \frac {\frac {A}{2\,a}+\frac {B\,1{}\mathrm {i}}{2\,a}}{d\,\left (1+\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}+\frac {A\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{a\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4\,a\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (3\,A+B\,1{}\mathrm {i}\right )}{4\,a\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.42, size = 122, normalized size = 1.97 \[ \frac {A \log {\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a d} + \begin {cases} - \frac {\left (- A - i B\right ) e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text {for}\: 4 a d e^{2 i c} \neq 0 \\x \left (- \frac {- 3 i A + B}{2 a} - \frac {\left (3 i A e^{2 i c} + i A - B e^{2 i c} - B\right ) e^{- 2 i c}}{2 a}\right ) & \text {otherwise} \end {cases} - \frac {x \left (3 i A - B\right )}{2 a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________